package com.wondertek.service.dto.app.req;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

/**
 * @description: 注册信息
 * @author: qinjianhui
 * @create: 2024-07-17 09:26
 **/
@Data
public class AppAuthRegisterReq {

    /*
    * 用户名称
    * */
    @NotBlank(message = "user.name.not.null")
    @Length(min = 1, max = 20, message = "user.name.length")
    @Schema(name = "nickname",description = "用户名称")
    private String nickname;

    /*
     * 邮箱
     * */
    @NotBlank(message = "email.not.null")
    @Pattern(regexp = "^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@"
            + "(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$", message = "verify.email")
    @Schema(name = "email",description = "邮箱")
    private String email;

    /*
     * 密码
     * */
    @NotBlank(message = "password.not.null")
    @Pattern(regexp = "^(?=.*[a-zA-Z])(?=.*\\d).{8,20}", message = "password.length")
    @Schema(name = "password",description = "密码")
    private String password;

    /*
     * 确认密码
     * */
    @NotBlank(message = "confirm.password.not.null")
    @Schema(name = "passwordConfirm",description = "确认密码")
    private String passwordConfirm;

    /*
     * 手机
     * */
    @Schema(name = "mobile",description = "手机号码")
    private String mobile;

}

